<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>animation动画</title>
    <style>
        .bollbox{
            border-bottom: 3px solid #ccc;
            border-right: 3px solid #ccc;
            width: 450px;
        }
        .boll {
            margin: 30px 0 0;
            width: 150px;
            height: 150px;
            background-color: #4158D0;
            background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
            border-radius: 50%;
            animation: run 1s linear;
            animation-fill-mode: forwards;  

            animation-play-state: paused;
        }
        @keyframes run {
            to{
                transform: translateX(300px) rotate(540deg);
            }
        }


        .btn:active +div{
            animation-play-state: running;
        }
    </style>
</head>

<body>
    <div class="bollbox">
        <button type="button" class="btn">按住开始，松开停止</button>
        <div class="boll"></div>
    </div>
    

    
</body>

</html>